package com.tom.zojbackendjudgeservice.controller;

import com.tom.zojbackendjudgeservice.judge.JudgeService;
import com.tom.zojbackendmodel.model.entity.QuestionSubmit;
import com.tom.zojbackendserviceclient.service.JudgeFeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/inner")
public class JudgeInnerController implements JudgeFeignClient {
    @Resource
    private JudgeService judgeService;

    //todo：可能传入一个Post请求
    @Override
    @GetMapping("/doJudge")
    public QuestionSubmit doJudge(@RequestParam("questionSubmitId") long questionSubmitId) {
        return judgeService.doJudge(questionSubmitId);
    }
}
